import 'package:sgy_flutter/model/device_model.dart';

enum HardwareVersion {
  DLS_1_0("DLS_V1.0"),
//你根据硬件版本号有没有PM开头的区分吧
  AXO_2_0("PM"),
  JT_1_0("JT");

  final String value;

  const HardwareVersion(this.value);

  bool sameVersion(DeviceModel? model) {
    return model?.name.startsWith(value) == true;
  }

  /**
   * 版本号为 1 2 3,小李来之前的版本
   */
  static bool isOldDevice(DeviceModel? model) {
    final old = model != null && model?.deviceSN == null || model?.deviceSN?.isEmpty == true;
    return old;
  }
}
